<?php
/**
 * 发送短信
 * Created by PhpStorm.
 * User: Yui
 * Date: 2017/5/15 0015
 * Time: 15:19
 */

namespace api\controllers;

use Yii;
use common\controllers\ApiCommonCtrl;
use common\services\AliSmsSve;

class SmsController extends ApiCommonCtrl
{

    /**
     * 注册短信
     * @return array
     */
    public function actionRegister()
    {
        $request = Yii::$app->request;
        $mobile = $request->get('mobile');
        $AliSmsSve = new AliSmsSve();
        return $AliSmsSve->send($mobile, '护身宝', 'SMS_55520003', 'register');
    }

    /**
     * 登录短信
     * @return array
     */
    public function actionLogin()
    {
        $request = Yii::$app->request;
        $mobile = $request->get('mobile');
        $AliSmsSve = new AliSmsSve();
        return $AliSmsSve->send($mobile, '护身宝', 'SMS_55520003', 'login');
    }

    /**
     * 重置密码短信
     * @return array
     */
    public function actionResetPwd()
    {
        $request = Yii::$app->request;
        $mobile = $request->get('mobile');
        $AliSmsSve = new AliSmsSve();
        return $AliSmsSve->send($mobile, '护身宝', 'SMS_55520003', 'reset_password');
    }

}